package com.yueyang.uc.server.service;

import com.yueyang.uc.server.mapper.UserMapper;
import com.yueyang.uc.server.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Stephen.Shi
 * @version v1
 * @summary
 * @Copyright (c) 2019, Lianjia Group All Rights Reserved.
 * @since 2020/1/27
 */
@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public void insert(User user) {
        this.userMapper.insertSelective(user);
    }

    public User findById(long id) {
        return this.userMapper.selectByPrimaryKey(id);
    }
}
